Subject: Re: BOOPSI-Button with Key Support
From: [email-masked] (Christoph Feck IRZ)
Date: Tue, 17 May 1994 18:42:00 GMT
Newsgroups: comp.sys.amiga.programmer

In article <inf01.769175363@apollo23>, [email-masked] (Hans-Joerg Frieden) writes:
> I just happened to be writing a program that needs some BOOSPI button
> gadgets. I need them with the little underscore to mark a keyboard
> shortcut, and they should be able to handle this by themselves.

Regarding keyboard input:  Intuition can only send input
to a gadget that is going to be activated (GM_ACTIVE),
or that is active and currently procssing input (GM_HANDLE).
In other words, your gadget will never know that the
user pressed a key unless you activated it yourself.

There are two solutions:  Have a master gadget, which
you keep active (ActivateGadget() it whenever you get
a IDCMP_GADGETUP or IDCMP_ACTIVEWINDOW) and which sends
all keyboard events to all it's subgadgets (groupgclass
will do this).

The other solution is to use IDCMP_RAWKEY (so that you
can recieve KEYUP events) and activate the gadget
associated with a given character yourself (MUI will
do this :)

3k// Christoph Feck, TowerSystems - BOOPSI Class Development
\X/ Amiga - Intuition inside.